
<div class ="col-md-1"></div>
 <div class ="col-md-10">
 <section class="cat-widget wdg-cat-opposite clearfix">
  <div class="widget-title">
      <h3><a href="<?php echo base_url("admin/restaurant");?>">Restaurant</a></h3>
      <span class="sub-title">จัดการร้านอาหาร</span>
      <div class="sep-widget"></div>
  </div>
  <br />
  <div class="row">
    <div class="col-md-8">
      <div class="restaurant-menu">
        <ul>
          <li><a class="glyphicon glyphicon-plus" href="<?php echo base_url("admin/restaurant/add");?>"> เพิ่มร้าน</a></li>
          <li><a class="glyphicon" href="<?php echo base_url("admin/restaurant/request-add");?>">แจ้งเพิ่มร้าน</a></li>
          <li><a class="glyphicon" href="<?php echo base_url("admin/restaurant/request-edit");?>">แจ้งแก้ไขร้าน</a></li>
          <li><a class="glyphicon" href="<?php echo base_url("admin/restaurant/request-del");?>">แจ้งลบร้าน</a></li>
        </ul>
      </div>
    </div>
    <div class="col-md-4">
        <form action="<?php echo base_url('admin/restaurant/search'); ?>" method="post" class="input-group">
          <input type="text" class="form-control" name="name" placeholder="ชื่อร้าน...">
          <span class="input-group-btn">
            <button class="btn btn-default" type="submit" name="submit">ค้นหา</button>
          </span>
        </form>
    </div>
  </div>
<div class="widget-title">
      <h3><a href="#">รายการร้านอาหาร</a></h3>
      <div class="sep-widget"></div>
</div>

<?php
    if (empty($resList)) {
?>
<div class="text-center error">
  <h2>ไม่มีข้อมูล</h2>
</div><br/>
<?php
}
else {
?>
<div class="table-responsive">
<table class="table table-hover">
    <tr class="success">
      <th>ID</th>
      <th>รูป</th>
      <th>ชื่อร้าน</th>
      <th>ผู้โพส</th>
      <th>โพสเมื่อ</th>
      <th>สถานะโพส</th>
      <th>Tool</th>
    </tr>


<?php
foreach ($resList as $key => $value) {
  
?>
  
    <tr class="warning">
      <td><?php echo $value["id"];?></td>

      <!--<td>
        <div class="thumbnail">
          <div class="caption">
              <h4>Thumbnail Headline</h4>
              <p>short thumbnail description</p>
              <p><a href="" class="label label-danger" rel="tooltip" title="Zoom">Zoom</a>
              <a href="" class="label label-default" rel="tooltip" title="Download now">Download</a></p>
          </div>
          <img src="" data-src="holder.js/80x80/vine" alt="Arrow">
        </div></td>-->
      <td>
       <div class="widget-content clearfix">
          <div class="wdg-news-in-pictures clearfix">
             <ul class="clearfix">
                <li class="tooltip_item post-thumbnail" data-toggle="tooltip" data-placement="top" title="จัดการรูปภาพสำหรับร้าน <?php echo $value["name"];?>">
                  <a href="<?php echo base_url("admin/restaurant/img/".$value["id"]);?>">
                    <img src="<?php echo $imagepath;?>/upload/<?php echo $value['img_filename'];?>" alt="" />
                  </a>
                </li>
             </ul>
          </div>
        </div>
      </td>
      <td><?php echo $value["name"];?></td>
      <td><?php echo $value["user"]["first_name"].$value["user"]["last_name"];?></td>
      <td><?php echo Util::ezDate($value["cr_date"]);?></td>
      <td><?php if ($value["status"]=="1") {
           echo "เผยแพร่แล้ว";
          }
          else if ($value["status"]=="0") {
            echo "แจ้งเพิ่ม";
          }
          else{
            echo "แจ้งลบ";
          }
       ?></td>
      <td><a class="btn btn-warning btn-sm glyphicon glyphicon-zoom-in" href="<?php echo base_url("admin/restaurant/edit/".$value["id"]);?>" title='edit'></a> :::: 
          <a class="btn btn-danger btn-sm glyphicon glyphicon-remove" href="<?php echo base_url("admin/restaurant/del/".$value["id"]);?>" title='delete'></a></td>
    </tr>
  


  <?php

}
  ?>
  </table>
  
 </div>
<?php }
?>
</section>
</div>
<div class ="col-md-1"></div>


<!--<a class="btn btn-danger btn-sm glyphicon glyphicon-remove" href="<?php echo base_url("restaurant/cat");?>" title='Check Tag'></a>-->